<h2> Ajouter un Pays</h2>

<?php
    echo $this->Form->create('PlaceCountry');
    echo $this->Form->input('name');
    echo $this->Form->input('code');
    echo $this->Form->end('Add');
?>

<h2> Les pays déja présents </h2>
<?php

if (!empty($countries)){
    ?>
<table>
    <thead>
        <tr>
            <td>Name</td>
            <td>Code</td>
            <td colspan="3">Options</td>
        </tr>
    </thead>
    <tbody>
<?php
    foreach ($countries as $country){
       $country = $country['PlaceCountry'];
       ?>
    <tr>
        <td> <?php echo $this->Html->link($country['name'], array('controller' => 'PlaceCountries', 'action' => 'admin_edit', $country['places_id']));?> </td>      
        <td> <?php echo $country['code'];?> </td>      
        <td> <?php echo $this->Html->link('Supprimer', array('controller' => 'Places', 'action' => 'admin_del', 'id' => $country['places_id'], 'controllerName' => 'PlaceCountries', 'actionName' => 'admin_index'));?> </td>      
        <td> <?php echo $this->Html->link('Modifier', array('controller' => 'PlaceCountries', 'action' => 'admin_edit', $country['places_id']));?> </td>      
    </tr>
    <?php
    }
    ?>
    </tbody>
</table>
    <?php
}
else{
    ?>
    <p>
        Aucun pays n'est enregistré !
    </p>
    <?php
}